 <!-- 追加报案   可以和reportForm合并  -->
<template>
     <div>     
        <div class="topsubmint el-col el-col-21">报案信息审核
            <el-button style="float: right; margin-right:50px;" type="primary" @click="reportall">提交审核</el-button>
        </div>
        <el-card class="box-card" style="margin-top:50px;">
            <el-card class="box-card">
                <div slot="header" class="card-heaer">
                    <span style="line-height: 36px;">被保险人信息</span>
                </div>
                <el-form :inline="true" :model="peopleinfo" label-width="160px" class="demo-form-inline">
                    <el-form-item label="被保险人姓名:">
                        <el-input v-model="peopleinfo.CUSTNAME" placeholder="被保险人姓名" :disabled="true"></el-input>
                    </el-form-item>
                    <el-form-item label="被保险人联系电话:" class="padleft-150">
                        <el-input v-model="peopleinfo.MOBILE" placeholder="被保险人联系电话" :disabled="true"></el-input>
                    </el-form-item>
    
                </el-form>
                <el-form :inline="true" :model="peopleinfo" label-width="160px" class="demo-form-inline">
    
                    <el-form-item label="关键联络人姓名:">
                        <el-input v-model="peopleinfo.Cname" placeholder="关键联络人姓名" :disabled="true"></el-input>
                    </el-form-item>
                    <el-form-item label="关键联络人联系电话:" class="padleft-150">
                        <el-input v-model="peopleinfo.Ctel" placeholder="关键联络人联系电话" :disabled="true"></el-input>
                    </el-form-item>
                </el-form>
                <el-form :inline="true" :model="peopleinfo" label-width="160px" class="demo-form-inline">
                    <el-form-item label="与被保险人的关系:">
                        <el-input v-model="peopleinfo.CTOCRELATION" placeholder="与被保险人的关系" :disabled="true"></el-input>
                    </el-form-item>
                </el-form>
            </el-card>
            <div class="space20">
            </div>
            <!--报案人信息录入-->
            <el-card class="box-card">
                <div slot="header" class="card-heaer">
                    <span style="line-height: 36px;">报案人信息录入</span>
                </div>
    
                <el-form :model="reportuser" ref="reportuser" label-width="200px">
                    <el-form-item label="报案人员身份:">
                        <el-radio-group v-model="reportuser.REPORTINFORMATION_IDENTITY" :disabled="true">
                            <el-radio label="客户报案"></el-radio>
                            <el-radio label="力众客服报案"></el-radio>
                        </el-radio-group>
                    </el-form-item>
                    <el-row type="flex" class="row-bg" v-if="reportuser.REPORTINFORMATION_IDENTITY=='力众客服报案'">
                        <el-col :span="10">
                            <el-form-item label="力众报案原因">
                                <el-input type="textarea" v-model="reportuser.REPORTINFORMATION_IDENTITYWHY" placeholder="力众报案原因" style="width:100%;" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>    
                    </el-row>
                    <el-row type="flex" class="row-bg"  v-if="reportuser.REPORTINFORMATION_IDENTITY=='客户报案'">
                        <el-col :span="6">
                            <el-form-item label="报案人与被保险人的关系:">
                                <el-select placeholder="报案人与被保险人的关系" v-model="reportuser.REPORTINFORMATION_RELATION" :disabled="true">
                                    <el-option label="父子" value="父子"></el-option>
                                    <el-option label="母子" value="母子"></el-option>
                                    <el-option label="夫妻" value="夫妻"></el-option>
                                    <el-option label="本人" value="本人"></el-option>
                                    <el-option label="其他" value="其他"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6" :offset="6">
                            <el-form-item label="报案方式:">
                                <el-select placeholder="报案方式" v-model="reportuser.REPORTINFORMATION_WAY" :disabled="true">
                                    <el-option label="电话" value="电话"></el-option>
                                    <el-option label="微信" value="微信"></el-option>
    
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row type="flex" class="row-bg">
                        <el-col :span="6">
                            <el-form-item label="报案人姓名:">
                                <el-input v-model="reportuser.REPORTINFORMATION_USERNAME" placeholder="报案人姓名" :disabled="true"></el-input>
                            </el-form-item>
    
                        </el-col>
                        <el-col :span="6" :offset="6"  v-if="reportuser.REPORTINFORMATION_IDENTITY=='客户报案'">
                            <el-form-item label="报案人联系电话:">
                                <el-input v-model="reportuser.REPORTINFORMATION_TEL" placeholder="报案人联系电话" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row type="flex" class="row-bg"  v-if="reportuser.REPORTINFORMATION_IDENTITY=='客户报案'">
                        <el-col :span="6">
                            <el-form-item label="报案人邮箱:">
                                <el-input v-model="reportuser.REPORTINFORMATION_EMAIL" placeholder="报案人邮箱" style="width:100%;" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
    
                    </el-row>
                    <el-row type="flex" class="row-bg">
                        <el-col :span="10">
                            <el-form-item label="报案事由:" prop="REPORTINFORMATION_CAUSE">
                                <el-input type="textarea" v-model="reportuser.REPORTINFORMATION_CAUSE" placeholder="报案事由" style="width:100%;" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
    
                    </el-row>
                    <el-form-item label="报案类型:" prop="type">
                        <el-cascader :options="reporttype" :show-all-levels="false" v-model="reportuser.type"></el-cascader>
                        <el-button type="primary" @click="submitForm">添加</el-button>
                        <!--<el-button type="danger" @click="delect">删除</el-button>-->
                    </el-form-item>
                </el-form>
            </el-card>
            <div v-for="(item,index) in fromlist" :key="index">
                <div class="space20">
                </div>
                <keep-alive v-if="item.key=='medical'">
                    <medical :ref="index+1" :isNewAdd="item.new" :model="index"  :newState="'追加'"  :ischeck="false"></medical>
                </keep-alive>
                <harmDie :ref="index+1" :isNewAdd="item.new" :model="index" :newState="'追加'"   :ischeck="false" :modelrules="harmDieRules" :name="item.key" v-if="item.key=='harmDie'"></harmDie>
                <harmDisability :ref="index+1" :isNewAdd="item.new"  :newState="'追加'"   :ischeck="false" :name="item.key" :model="index" :modelrules="harmDisabilityRules" v-if="item.key=='harmDisability'"></harmDisability>
                <rescueMeidca :ref="index+1" :isNewAdd="item.new"  :newState="'追加'"  :ischeck="false" :name="item.key" :model="index" :modelrules="rescueMeidcaRules" v-if="item.key=='rescueMeidca'"></rescueMeidca>
                <rescueMove :ref="index+1" :isNewAdd="item.new"  :newState="'追加'"  :ischeck="false" :name="item.key" :model="index" :modelrules="rescueMoveRules" v-if="item.key=='rescueMove'"></rescueMove>
                <rescueReturned :ref="index+1" :isNewAdd="item.new"  :newState="'追加'"   :ischeck="false" :name="item.key" :model="index" :modelrules="rescueReturnedRules" v-if="item.key=='rescueReturned'"></rescueReturned>
                <rescueVisit :ref="index+1" :isNewAdd="item.new"  :newState="'追加'"  :ischeck="false" :name="item.key" :model="index" :modelrules="rescueVisitRules" v-if="item.key=='rescueVisit'"></rescueVisit>
                <rescueInter :ref="index+1" :isNewAdd="item.new"  :newState="'追加'"   :ischeck="false" :name="item.key" :model="index" :modelrules="rescueInterRules" v-if="item.key=='rescueInter'"></rescueInter>
                <studyBreak :ref="index+1" :isNewAdd="item.new"  :newState="'追加'"   :ischeck="false" :name="item.key" :model="index" :modelrules="studyBreakRules" v-if="item.key=='studyBreak'"></studyBreak>
                <travelDelay :ref="index+1" :isNewAdd="item.new"  :newState="'追加'"   :ischeck="false" :name="item.key" :model="index" :modelrules="travelDelayRules   " v-if="item.key=='travelDelay'"></travelDelay>
                <travelLose :ref="index+1" :isNewAdd="item.new"  :newState="'追加'" :ischeck="false" :name="item.key" :model="index" :modelrules="travelLoseRules" v-if="item.key=='travelLose'"></travelLose>
                <three :ref="index+1" :isNewAdd="item.new"  :newState   ="'追加'"   :ischeck="false" :name="item.key" :model="index" :modelrules="threeRules" v-if="item.key=='three'"></three>
                <rescueAccompany :ref="index+1" :isNewAdd="item.new"  :newState="'追加'"   :ischeck="false" :name="item.key" :model="index" :modelrules="threeRules" v-if="item.key=='rescueAccompany'"></rescueAccompany>
            </div>
    
            <!--<medical ref="medicalform" :checkmedical="checkmedical"  ></medical>-->
        </el-card>
    </div>
</template>

<script>
import medical from '@/components/reportForm/medical';
import harmDie from '@/components/reportForm/harmDie';
import harmDisability from '@/components/reportForm/harmDisability';
import rescueMeidca from '@/components/reportForm/rescueMeidca';
import rescueMove from '@/components/reportForm/rescueMove';
import rescueReturned from '@/components/reportForm/rescueReturned';
import rescueVisit from '@/components/reportForm/rescueVisit';
import rescueInter from '@/components/reportForm/rescueInter';
import studyBreak from '@/components/reportForm/studyBreak';
import travelDelay from '@/components/reportForm/travelDelay';
import travelLose from '@/components/reportForm/travelLose';
import three from '@/components/reportForm/three';
import rescueAccompany from '@/components/reportForm/rescueAccompany';
import {
    mapState
} from 'vuex';
import getid from '@/js/getid';
export default {
    data() {
        return {
            peopleinfo: {},
            //是否可删除
            checkmedical: true,
            reporttype: [],
            add: 0

        }
    },
    components: {
        'medical': medical,
        'harmDie': harmDie,
        'harmDisability': harmDisability,
        'rescueMeidca': rescueMeidca,
        'rescueMove': rescueMove,
        'rescueReturned': rescueReturned,
        'rescueVisit': rescueVisit,
        'rescueInter': rescueInter,
        'studyBreak': studyBreak,
        'travelDelay': travelDelay,
        'travelLose': travelLose,
        'three': three,
        'rescueAccompany': rescueAccompany
    },
    computed: mapState({
        // 报案人信息
        reportuser: state => state.reportform.reportuser,
        rules: state => state.reportform.rules,
        reporttype1: state => state.reportform.reporttype1,
        reporttype2: state => state.reportform.reporttype2,
        reporttype3: state => state.reportform.reporttype3,
        //报案类型数组
        fromlist: state => state.reportform.fromlist,
        //医疗保险报案信息
        medical: state => state.reportform.medical,
        //意外死亡
        harmDie: state => state.reportFormItem.harmDie,
        harmDieRules: state => state.reportFormItem.harmDieRules,
        //意外伤残
        harmDisability: state => state.reportFormItem.harmDisability,
        harmDisabilityRules: state => state.reportFormItem.harmDisabilityRules,
        //全球紧急救援-紧急医疗
        rescueMeidca: state => state.reportFormItem.rescueMeidca,
        rescueMeidcaRules: state => state.reportFormItem.rescueMeidcaRules,
        //全球紧急救援-紧急转院
        rescueMove: state => state.reportFormItem.rescueMove,
        rescueMoveRules: state => state.reportFormItem.rescueMoveRules,
        //全球紧急救援-紧急运返
        rescueReturned: state => state.reportFormItem.rescueReturned,
        rescueReturnedRules: state => state.reportFormItem.rescueReturnedRules,
        //陪同
        rescueAccompany: state => state.reportFormItem.rescueAccompany,
        rescueAccompanyRules: state => state.reportFormItem.rescueAccompanyRules,
        //全球紧急救援-探访
        rescueVisit: state => state.reportFormItem.rescueVisit,
        rescueVisitRules: state => state.reportFormItem.rescueVisitRules,
        //全球紧急救援-探访
        rescueInter: state => state.reportFormItem.rescueInter,
        rescueInterRules: state => state.reportFormItem.rescueInterRules,
        //学业中断
        studyBreak: state => state.reportFormItem.studyBreak,
        studyBreakRules: state => state.reportFormItem.studyBreakRules,
        //旅行延误
        travelDelay: state => state.reportFormItem.travelDelay,
        travelDelayRules: state => state.reportFormItem.travelDelayRules,
        //旅行延误
        travelLose: state => state.reportFormItem.travelLose,
        travelLoseRules: state => state.reportFormItem.travelLoseRules,
        //旅行延误
        three: state => state.reportFormItem.three,
        threeRules: state => state.reportFormItem.threeRules,
    }),
    methods: {
        submitForm() {

            var obj = {
                key: this.reportuser.type[1],
                new: true,
                obj: {}
            };
            switch (this.reportuser.type[1]) {
                case 'medical':
                    this.medical.RI_MEDICAL_ID = getid.getid();
                    this.medical.RI_MEDICAL_STATE = "需审核"
                    obj.obj = JSON.parse(JSON.stringify(this.medical));
                    break;
                case 'harmDie':
                    this.harmDie.RI_DIED_ID = getid.getid();
                    this.harmDie.RI_DIED_STATE = "需审核";
                    obj.obj = JSON.parse(JSON.stringify(this.harmDie));
                    break;
                case 'harmDisability':
                    this.harmDisability.RI_INJURE_ID = getid.getid();
                    this.harmDisability.RI_INJURE_STATE = "需审核";

                    obj.obj = JSON.parse(JSON.stringify(this.harmDisability));
                    //    obj.obj=this.harmDisability;
                    break;
                case 'rescueMeidca':
                    this.rescueMeidca.RI_HMEDIA_ID = getid.getid();
                    this.rescueMeidca.RI_HMEDIA_STATE = "需审核";
                    obj.obj = JSON.parse(JSON.stringify(this.rescueMeidca));
                    //    obj.obj=this.rescueMeidca;
                    break;
                case 'rescueMove':
                    this.rescueMove.RI_HCHANGE_ID = getid.getid();
                    this.rescueMove.RI_HCHANGE_STATE = "需审核";
                    obj.obj = JSON.parse(JSON.stringify(this.rescueMove));
                    //    obj.obj=this.rescueMove;
                    break;
                case 'rescueReturned':
                    this.rescueReturned.RI_HBACK_ID = getid.getid();
                    this.rescueReturned.RI_HBACK_STATE = "需审核";
                    obj.obj = JSON.parse(JSON.stringify(this.rescueReturned));
                    //    obj.obj=this.rescueReturned;
                    break;
                case 'rescueVisit':
                    this.rescueVisit.RI_HVISIT_ID = getid.getid();
                    this.rescueVisit.RI_HVISIT_STATE = "需审核";
                    obj.obj = JSON.parse(JSON.stringify(this.rescueVisit));
                    //    obj.obj=this.rescueVisit;
                    break;
                case 'rescueInter':
                    this.rescueInter.RI_HBURIAL_ID = getid.getid();
                    this.rescueInter.RI_HBURIAL_STATE = "需审核";
                    obj.obj = JSON.parse(JSON.stringify(this.rescueInter));
                    //    obj.obj=this.rescueInter;
                    break;
                case 'studyBreak':
                    this.studyBreak.RI_ACADEMIC_ID = getid.getid();
                    this.studyBreak.RI_ACADEMIC_STATE = "需审核";
                    obj.obj = JSON.parse(JSON.stringify(this.studyBreak));
                    //    obj.obj=this.studyBreak;
                    break;
                case 'travelDelay':
                    this.travelDelay.RI_TRAVELDELAY_ID = getid.getid();
                    this.travelDelay.RI_TRAVELDELAY_STATE = "需审核";
                    obj.obj = JSON.parse(JSON.stringify(this.travelDelay));
                    //    obj.obj=this.travelDelay;
                    break;
                case 'travelLose':
                    this.travelLose.RI_LOSE_ID = getid.getid();
                    this.travelLose.RI_LOSE_STATE = "需审核";
                    obj.obj = JSON.parse(JSON.stringify(this.travelLose));
                    //    obj.obj=this.travelLose;
                    break;
                case 'three':
                    this.three.RI_OTHER_ID = getid.getid();
                    this.three.RI_OTHER_STATE = "需审核";
                    obj.obj = JSON.parse(JSON.stringify(this.three));
                    //    obj.obj=this.three;
                    break;
                case 'rescueAccompany':
                    this.rescueAccompany.RI_HACCOMPANY_ID = getid.getid();
                    this.rescueAccompany.RI_HACCOMPANY_STATE = "需审核";
                    obj.obj = JSON.parse(JSON.stringify(this.rescueAccompany));
                    //    obj.obj=this.three;
                    break;

            }
          
            this.fromlist.unshift(obj);
         
            // switch (this.reportuser.type[1]) {
            //     case 'medical':
            //         this.ismedical = true;
            //         break;
            // }
        },
        reportall() {
            if (this.fromlist.length <= this.add) {
                this.$notify.error({
                    title: '提交失败',
                    message: "您还没有新增报案"
                });
                return;
            }
            var model = JSON.parse(JSON.stringify(this.reportuser));
            model.RI_MEDICAL = new Array;
            model.RI_ACADEMIC = new Array;
            model.RI_HBACK = new Array;
            model.RI_HBURIAL = new Array;
            model.RI_HCHANGE = new Array;
            model.RI_HMEDIA = new Array;
            model.RI_HVISIT = new Array;
            model.RI_LOSE = new Array;
            model.RI_OTHER = new Array;
            model.RI_TRAVELDELAY = new Array;
            model.RI_DIED = new Array;
            model.RI_INJURE = new Array;
            model.RI_HACCOMPANY = new Array;
            var sure = 0;
            let that = this;
            for (var i = 0; i < that.fromlist.length; i++) {
            
                if (!that.fromlist[i].new) {
                    continue;
                }
                var resultModel = JSON.parse(JSON.stringify(that.fromlist[i].obj));
                switch (that.fromlist[i].key) {
                    case 'medical':
                        resultModel.RI_MEDICAL_ADDRESS = resultModel.RI_MEDICAL_ADDRESS.join(",");
                        model.RI_MEDICAL.push(resultModel);
                        break;
                    case 'harmDie':
                        resultModel.RI_DIED_ADDRESS = resultModel.RI_DIED_ADDRESS.join(",");
                        model.RI_DIED.push(resultModel);
                        break;
                    case 'harmDisability':
                        resultModel.RI_INJURE_ADDRESS = resultModel.RI_INJURE_ADDRESS.join(",");
                        model.RI_INJURE.push(resultModel);
                        break;
                    case 'rescueMeidca':
                        resultModel.RI_HMEDIA_ADDRESS = resultModel.RI_HMEDIA_ADDRESS.join(",");
                        model.RI_HMEDIA.push(resultModel);
                        break;
                    case 'rescueMove':
                        resultModel.RI_HCHANGE_ADDRESS = resultModel.RI_HCHANGE_ADDRESS.join(",");
                        model.RI_HCHANGE.push(resultModel);
                        break;
                    case 'rescueReturned':
                        resultModel.RI_HBACK_ADDRESS = resultModel.RI_HBACK_ADDRESS.join(",");
                        model.RI_HBACK.push(resultModel);
                        break;
                    case 'rescueAccompany':
                        resultModel.RI_HACCOMPANY_ADDRESS = resultModel.RI_HACCOMPANY_ADDRESS.join(",");
                        model.RI_HACCOMPANY.push(resultModel);
                        break;
                    case 'rescueVisit':
                        resultModel.RI_HVISIT_ADDRESS = resultModel.RI_HVISIT_ADDRESS.join(",");
                        model.RI_HVISIT.push(resultModel);
                        break;
                    case 'rescueInter':
                        resultModel.RI_HBURIAL_ADDRESS = resultModel.RI_HBURIAL_ADDRESS.join(",");
                        model.RI_HBURIAL.push(resultModel);
                        break;
                    case 'studyBreak':
                        model.RI_ACADEMIC.push(resultModel);
                        break;
                    case 'travelDelay':
                        model.RI_TRAVELDELAY.push(resultModel);
                        break;
                    case 'travelLose':
                        model.RI_LOSE.push(resultModel);
                        break;
                    case 'three':
                        resultModel.RI_OTHER_ADDRESS = resultModel.RI_OTHER_ADDRESS.join(",");
                        model.RI_OTHER.push(resultModel);
                        break;
                }
            }    
            this.$http.put("ReportInfomation/Zadd", model).then(response => {
                var data = response.body;
                if (data.code == 1) {
                    this.$store.commit('fromlistEmpty', []);
                    this.$notify({
                        title: '添加成功',
                        message: '添加成功',
                        type: 'success'
                    });
                    this.$router.push({
                        name: 'ReportAdd'
                    });

                } else {
                    this.loding = false;
                    this.$notify.error({
                        title: '提交失败',
                        message: data.msg
                    });
                }
            }, response => {
                this.$notify.error({
                    title: '网络错误',
                    message: '网络错误'
                });
                this.loding = false;
            })
        },

        listget(arry, key) {
            if (arry == null) {
                return;
            }
            for (var i = 0; i < arry.length; i++) {
                switch (key) {
                    case 'medical':
                        if (arry[i].RI_MEDICAL_ADDRESS)
                            arry[i].RI_MEDICAL_ADDRESS = this.addressGet(arry[i].RI_MEDICAL_ADDRESS);
                        break;
                    case 'harmDie':
                        if (arry[i].RI_DIED_ADDRESS)
                            arry[i].RI_DIED_ADDRESS = this.addressGet(arry[i].RI_DIED_ADDRESS);
                        break;
                    case 'harmDisability':
                        if (arry[i].RI_INJURE_ADDRESS)
                            arry[i].RI_INJURE_ADDRESS = this.addressGet(arry[i].RI_INJURE_ADDRESS);
                        break;
                    case 'rescueMeidca':
                        if (arry[i].RI_HMEDIA_ADDRESS)
                            arry[i].RI_HMEDIA_ADDRESS = this.addressGet(arry[i].RI_HMEDIA_ADDRESS);
                        break;
                    case 'rescueMove':
                        if (arry[i].RI_HCHANGE_ADDRESS)
                            arry[i].RI_HCHANGE_ADDRESS = this.addressGet(arry[i].RI_HCHANGE_ADDRESS);
                        break;
                    case 'rescueReturned':
                        if (arry[i].RI_HBACK_ADDRESS)
                            arry[i].RI_HBACK_ADDRESS = this.addressGet(arry[i].RI_HBACK_ADDRESS);
                        break;
                    case 'rescueAccompany':
                        if (arry[i].RI_HACCOMPANY_ADDRESS)
                            arry[i].RI_HACCOMPANY_ADDRESS = this.addressGet(arry[i].RI_HACCOMPANY_ADDRESS);
                        break;
                    case 'rescueVisit':
                        if (arry[i].RI_HVISIT_ADDRESS)
                            arry[i].RI_HVISIT_ADDRESS = this.addressGet(arry[i].RI_HVISIT_ADDRESS);
                        break;
                    case 'rescueInter':
                        if (arry[i].RI_HBURIAL_ADDRESS)
                            arry[i].RI_HBURIAL_ADDRESS = this.addressGet(arry[i].RI_HBURIAL_ADDRESS);
                        break;
                    case 'studyBreak':
                    //uat时间转换 
  arry[i].BILL_TRAVELDELAY_FACTARBILLVE= new Date((new Date(arry[i].BILL_TRAVELDELAY_FACTARBILLVE)/1000+28800)*1000);
    arry[i].BILL_TRAVELDELAY_FACTOUT= new Date((new Date(arry[i].BILL_TRAVELDELAY_FACTOUT)/1000+28800)*1000);
     arry[i].BILL_TRAVELDELAY_PLANARBILLVE= new Date((new Date(arry[i].BILL_TRAVELDELAY_PLANARBILLVE)/1000+28800)*1000);
    arry[i].BILL_TRAVELDELAY_PLANOUT= new Date((new Date(arry[i].BILL_TRAVELDELAY_PLANOUT)/1000+28800)*1000);
                        break;
                    case 'travelDelay':

                        break;
                    case 'travelLose':

                        break;
                    case 'three':
                        if (arry[i].RI_OTHER_ADDRESS)
                            arry[i].RI_OTHER_ADDRESS = this.addressGet(arry[i].RI_OTHER_ADDRESS);
                        break;
                }
                var obj = {
                    key: key,
                    obj: arry[i]
                };
                this.fromlist.push(obj);
            }

        },
        addressGet(ad) {
            var address = ad.split(",");
            address[2] = address[2] + "," + address[3];
            address[3] = null;
            return address;
        }

    },
    activated() {      
        if (this.$route.query["type"].indexOf("畅游") > 0) {
            this.reporttype = this.reporttype1;
        } else if (this.$route.query["type"].indexOf("周详") > 0) {
            this.reporttype = this.reporttype2;
        } else if (this.$route.query["type"].indexOf("安心") > 0) {
            this.reporttype = this.reporttype3;
        } else {
            this.reporttype = [];
            this.$notify.error({
                title: '无此产品产品利益表',
                message: '无此产品产品利益表'
            });
        }
        this.$store.commit('fromlistEmpty', []);
        this.$http.get("ReportInfomation?id=" + this.$route.query["id"]).then(response => {
            var data = response.body;
            if (data.code == 1) {
                var datajson = data.result[0];
                this.reportuser.REPORTINFORMATION_ID = datajson.REPORTINFORMATION_ID;
                this.reportuser.REPORTINFORMATION_IDENTITY = datajson.REPORTINFORMATION_IDENTITY;
                this.reportuser.REPORTINFORMATION_RELATION = datajson.REPORTINFORMATION_RELATION;
                this.reportuser.REPORTINFORMATION_USERNAME = datajson.REPORTINFORMATION_USERNAME;
                this.reportuser.REPORTINFORMATION_WAY = datajson.REPORTINFORMATION_WAY;
                this.reportuser.REPORTINFORMATION_TEL = datajson.REPORTINFORMATION_TEL;
                this.reportuser.REPORTINFORMATION_EMAIL = datajson.REPORTINFORMATION_EMAIL;

                this.listget(datajson.RI_MEDICAL, 'medical');
                this.listget(datajson.RI_DIED, 'harmDie');
                this.listget(datajson.RI_INJURE, 'harmDisability');
                this.listget(datajson.RI_HMEDIA, 'rescueMeidca');
                this.listget(datajson.RI_HCHANGE, 'rescueMove');
                this.listget(datajson.RI_HBACK, 'rescueReturned');
                this.listget(datajson.RI_HVISIT, 'rescueVisit');
                this.listget(datajson.RI_HACCOMPANY, 'rescueAccompany');
                this.listget(datajson.RI_HBURIAL, 'rescueInter');
                this.listget(datajson.RI_ACADEMIC, 'studyBreak');
                this.listget(datajson.RI_TRAVELDELAY, 'travelDelay');
                this.listget(datajson.RI_LOSE, 'travelLose');
                this.listget(datajson.RI_OTHER, 'three');
                this.add = this.fromlist.length;
            } else {
                this.$notify.error({
                    title: '失败',
                    message: '数据获取失败'
                });
            }
        }, response => {
            this.$notify.error({
                title: '网络错误',
                message: '网络错误'
            });
            this.loding = false;
        });
        this.$http.get("OrderList?id=" + this.$route.query["sid"]).then(response => {
            var data = response.body;
           
            if (data.code == 1) {
                this.peopleinfo = data.result[0];
            } else {
                this.$notify.error({
                    title: '失败',
                    message: '数据获取失败'
                });
            }
        }, response => {
            this.$notify.error({
                title: '网络错误',
                message: '网络错误'
            });
            this.loding = false;
        });
    }

}
</script>
